package com.hsl.housaileibot001.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 基础实体类，包含所有实体的公共字段
 */
@Data
@TableName("base_entity")
@Schema(description = "基础实体类")
@AllArgsConstructor
@NoArgsConstructor
public class BaseEntity {

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private Long createdBy;

    /**
     * 更新人
     */
    @Schema(description = "更新人")
    private Long updatedBy;

    /**
     * 版本号
     */
    @Version
    @Schema(description = "版本号")
    private Integer version;

    /**
     * 是否删除
     */
    @TableLogic
    @Schema(description = "是否删除")
    private Boolean deleted;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
}